<template>
  <div class='unit' @click="jumpPage">
    <img :src="formaltInfo.mainImage ||defaultImg" alt="defaultImg">
      <p class="info">
        <span class="color-red">￥：{{formaltInfo.price ||"暂无价格"}}</span>
        <span class="fr ft12 color-999">销量：{{formaltInfo.salesCount||"暂无"}}</span>
      </p>
      <p class="intro ft14">{{formaltInfo.name||"暂无"}}</p>

    <p class="shop-info" >
      <span :class="{'icon-dianpu':formaltInfo.storeId!=1,'iconfont':formaltInfo.storeId!=1,'bc-green':formaltInfo.storeId==1,'color-white':formaltInfo.storeId==1}">{{formaltInfo.storeId==1?"自营":""}}</span>
      <span class="shop-name white-space color-999">{{formaltInfo.storeName||"暂无名称"}}</span>
      <span class="address color-999 ml-auto">{{formaltInfo.address||"暂无地址"}}</span>
    </p>
     <!-- <p class="shop-info" v-if="showShopInfo">
        <span :class="{'icon-dianpu':!formaltInfo.shopInfo.is_self,'iconfont':!formaltInfo.shopInfo.is_self,'bc-green':formaltInfo.shopInfo.is_self,'color-white':formaltInfo.shopInfo.is_self}">{{formaltInfo.shopInfo.is_self?"自营":""}}</span>
        <span class="shop-name white-space color-999">{{formaltInfo.shopInfo.name||"暂无名称"}}</span>
        <span class="address color-999 ml-auto">{{formaltInfo.shopInfo.address||"暂无地址"}}</span>
      </p>-->
  </div>
</template>
<script>
export default {
  props:['info','showShopInfo'],
  components: {},
  name: "",
  data() {
    return {
      defaultImg:require('@/assets/imgs/windshop/default.jpg'),
    };
  },
  computed:{
    formaltInfo(){
      return this.info
    }
  },
  methods: {
      jumpPage(){
          //alert(this.formaltInfo.id)
          this.$router.push({path:"/productDetails",query:{id:this.formaltInfo.id,shopId:this.formaltInfo.storeId}})
      }
  },
  created() {}
};
</script>
<style lang="scss" scoped>
.unit {
  margin: 0 15px;
  padding: 15px 0;

  img{
    width: 90%;
    margin: 10px auto;
  }
  .intro{
    overflow : hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break:break-all;
  }

  .shop-info{
    font-size: 12px;
    margin-top: 5px;
    display: flex;

    .shop-name{
      margin:0 5px;
    }
  }
  .bc-green{
    padding: 0 2px;
  }
  .iconfont{
    color: $yellow;
  }
}
</style>